package com.yfp.client.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.client.domain.OrderList;
import com.yfp.client.mapper.OrderListMapper;
import com.yfp.client.service.OrderListService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * @description 针对表【order_list(订单表)】的数据库操作Service实现
 * @createDate 2024-06-20 19:28:46
 */
@Service
public class OrderListServiceImpl extends ServiceImpl<OrderListMapper, OrderList> implements OrderListService {

    @Resource
    private OrderListMapper orderListMapper;

    /**
     * 根据订单id查询订单
     *
     * @param orderId
     * @return
     */
    @Override
    public List<OrderList> listByOrderSn(String orderId) {
        return orderListMapper.listByOrderSn(orderId);
    }

    /**
     * 根据订单id查询订单
     *
     * @param orderDetailId
     * @return
     */
    @Override
    public OrderList listByOrderDetailId(String orderDetailId) {
        return baseMapper.selectById(orderDetailId);
    }

    @Override
    public List<OrderList> listByOrderSnAndStatus(String orderId, int status) {
        return orderListMapper.listByOrderSnAndStatus(orderId, status);
    }

    @Override
    public List<OrderList> listByComboId(String comboId) {
        return orderListMapper.listByComboId(comboId);
    }

    @Override
    public String findLastPositionIdByClinetId(String clientId) {
        return orderListMapper.findLastPositionIdByClinetId(clientId);
    }

    @Override
    public void updateGiftGoldById(String orderListId, BigDecimal giftGold) {
        orderListMapper.updateGiftGoldById(orderListId, giftGold);
    }
}




